home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
ole
/
oledsrvr
/
client.frm
next >
Wrap
Text File
|
1996-01-04
|
3KB
|
124 lines
VERSION 4.00
Begin VB.Form frmClient
Caption = "Get Next Item"
ClientHeight = 1320
ClientLeft = 585
ClientTop = 930
ClientWidth = 3300
Height = 1725
Left = 525
LinkTopic = "Form1"
ScaleHeight = 1320
ScaleWidth = 3300
Top = 585
Width = 3420
Begin VB.TextBox Text1
Height = 855
Left = 2010
MultiLine = -1 'True
TabIndex = 3
Top = 90
Width = 1215
End
Begin VB.Timer Timer1
Interval = 1000
Left = 210
Top = 1125
End
Begin VB.CommandButton Command1
Caption = "Request"
Height = 450
Left = 75
TabIndex = 0
Top = 75
Width = 1830
End
Begin VB.Label Label2
Alignment = 1 'Right Justify
Caption = "time"
ForeColor = &H000000FF&
Height = 225
Left = 1140
TabIndex = 2
Top = 1080
Width = 2100
End
Begin VB.Label Label1
Caption = "Label1"
Height = 360
Left = 75
TabIndex = 1
Top = 615
Width = 1845
End
End
Attribute VB_Name = "frmClient"
Attribute VB_Creatable = False
Attribute VB_Exposed = False
Option Explicit
'-- Technique 'A': will instantiate on Form Load:
Private objDataServer As ServerTest3.CDataServer
'-- Technique 'B': will instantiate on first Request
' (need to comment out 'Set objDataServer = New ServerTest3.CDataServer'
' in Form Load event).
'Private objDataServer As New ServerTest3.CDataServer
Private objRequest As New CRequest
Public mstrProgID As String
Public Function Request() As Boolean
On Error Resume Next
objDataServer.RegisterRequest objRequest
If Err Then
Label1 = "Error: " & Err.Description
On Error GoTo 0
Request = False
Else
Request = True
Label1 = "Request in process"
End If
End Function
Private Sub Command1_Click()
Request
Text1.SetFocus
End Sub
Private Sub Form_Load()
'----- comment out next line when using 'Technique B' for
' instantiating classes - see Declarations section.
Set objDataServer = New ServerTest3.CDataServer
mstrProgID = Format(Now, "hhmmss")
Me.Caption = "OLE Client: " & mstrProgID
End Sub
Private Sub Form_Unload(Cancel As Integer)
Set objDataServer = Nothing
Set objRequest = Nothing
End Sub
Private Sub Timer1_Timer()
Label2 = Time
End Sub